<pre id="log"></pre>
<script src="congee.js"></script>
<script>
if((typeof console) == "undefined"){
  var console = {
    log: function(msg){
      var div = document.createElement("div");
      div.innerHTML = msg;
      document.getElementById("log").appendChild(div);
    }
  };
}

Congee.add(/\.(html)$/, function(format){
  console.log("format: "+format);
}, {go_on: true, raw: true})
.add(/^C:/, function(){
  console.log("C drive");
})
.add("DOES_NOT_MATCH", function(){
  console.log("shouldn't show up");
})
.defaults(function(){
  console.log("default");
})
.before(function(){
  if(!this.param("test")){
    window.location = "?test=true&a[]=b&a[]=c&a=ddd&123=kthxbai&space=aaa[1+2+3+4%205]asd";
  }else{
    console.log("before");
    console.log(this.param("a[]") instanceof Array && this.param("a[]").length == 2);
    console.log(this.param("a") == "ddd");
    console.log(this.param("123") == "kthxbai");
    console.log(this.param("space") == "aaa[1 2 3 4 5]asd");
  }
})
.after(function(){
  console.log("after");
})
.run();
</script>